<script >

import webAside from "@/components/webAside.vue";
import webHeader from "@/components/webHeader.vue";
import webMain from "@/components/webMain.vue";

export  default {
  name: "HomeIndex",
  components: {webAside,webHeader,webMain},
  data(){
    return{
      isCollapse:false,
      aisde_width:'200px',
      icon:'el-icon-s-fold'
    }
  },
  methods:{
    doCollapse(){
      console.log(1111)
      this.isCollapse = !this.isCollapse
      if(!this.isCollapse){//展开
        this.aisde_width='200px'
        this.icon='el-icon-s-fold'
      }else {//关闭
        this.aisde_width='64px'
        this.icon='el-icon-s-unfold'
      }
    }
  }
}
</script>

<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-aside :width="aisde_width" style="background-color: rgb(238, 241, 246);height: 100%;margin-left: -1px">
      <webAside :isCollapse = "isCollapse"></webAside>
    </el-aside>

    <el-container style="height: 100%">
      <el-header style="text-align: right; font-size: 12px">
        <webHeader @doCollapse="doCollapse" :icon="icon"></webHeader>
      </el-header>

      <el-main>
        <webMain></webMain>
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped>
.el-header {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}
.el-main{
  padding: 5px;
}
.el-aside {
  color: #333;
}

</style>